Name: Additional Member Status: Creative Team v1.1

Version: 1.1

Last modified: 08/01/2009 @ 12:00 (GMT)

Description: This modification will add a new status to the ranks.
                   The new status will have the same powers as Super Moderators.
                   This modification is compatible with User Rank Icons.
                   This modification is compatible with users viewing page.

Compatibility: XMB 1.9.8 SP3

Updated for 1.9.8 By: WormHole @ XMB Garage

Code Developed By: Adam Clarke (http://www.xmbservices.com)

MOD History: V1.0 (20/07/2005 @ 17:35) - Initial Release.
             V1.1 (30/09/2005 @ 18:30) - Cleaned up / repaired code.
             V1.1 (30/07/2006 @ 13:00) - Updated for XMB 1.9.5
             V1.1 (08/01/2009 @ 12:00) - Updated for XMB 1.9.8

License Note: This modification is released under the GPL License. A copy is provided with this software package.

Note: Backup all affected files, templates & databases.

Affected Files: header.php, index.php, portal.php, misc.php, member.php, memcp.php, viewthread.php, faq.php, cp.php, cp2.php, lang/English.lang.php

Affected Templates: index_whosonline, portal_whosonline

====================================================================================================
=======
Step 1:
=======]
====================================
Go To Administration Panel -->  Insert Raw SQL
====================================
Upload SQL.txt and click Submit Changes.
====================================================================================================
=======
Step 2:
=======
================
Edit File: header.php
================
==========
Find Code:
==========

        case 'Moderator':
            $role['sadmin'] = false;
            $role['admin'] = false;
            $role['smod'] = false;
            $role['mod'] = true;
            $role['staff'] = true;
            break;

===============
Add Code Below:
===============

        // Additional Member Status: Creative Team Mod Begin
        case 'Creative Team':
            $role['sadmin'] = false;
            $role['admin']  = false;
            $role['smod']   = true;
            $role['mod']    = true;
            $role['staff']  = true;
            break;
        // Additional Member Status: Creative Team Mod End

====================================================================================================
=======
Step 3:
=======
============================================================
Edit File: include/uvp.inc.php (If Users Viewing Page: Rank Icon Version Is Installed)
============================================================
==========
Find Code:
==========

            case 'Moderator':
                $ricon = '<img src="'.$THEME['imgdir'].'/online_mod.gif" border="0px" alt="'.$lang['textmod'].'" title="'.$lang['textmod'].'" />';
                break;

===============
Add Code Below:
===============

            // Additional Member Status: Creative Team Mod Begin
            case 'Creative Team':
                $ricon = '<img src="'.$THEME['imgdir'].'/online_creativeteam.gif" border="0px" alt="'.$lang['creativeteam'].'" title="'.$lang['creativeteam'].'" />';
                break;
            // Additional Member Status: Creative Team Mod End

====================================================================================================
=======
Step 4:
=======
=====================================
Edit File: index.php (If User Rank Icons Is Installed)
=====================================
==========
Find Code:
==========

            // User Rank Icons Mod Begin
            $supadminkey = $adminkey = $supmodkey = $modkey = $memkey = '';
            $supadminkey = '<img src="./images/ricons/onlineSuperAdministrator.gif" border="0px" alt="'.$lang['ranksupadmin'].'" title="'.$lang['ranksupadmin'].'" /><strong><u><em>'.$lang['superadmin'].'</em></u></strong> - ';
            $adminkey = '<img src="./images/ricons/onlineAdministrator.gif" border="0px" alt="'.$lang['rankadmin'].'" title="'.$lang['rankadmin'].'" /><strong><u>'.$lang['textsendadmin'].'</u></strong> - ';
            $supmodkey = '<img src="./images/ricons/onlineSuperModerator.gif" border="0px" alt="'.$lang['ranksupmod'].'" title="'.$lang['ranksupmod'].'" /><em><strong>'.$lang['textsendsupermod'].'</strong></em> - ';
            $modkey = '<img src="./images ricons/onlineModerator.gif" border="0px" alt="'.$lang['rankmod'].'" title="'.$lang['rankmod'].'" /><strong>'.$lang['textsendmod'].'</strong> - ';
            $memkey = '<img src="./images/ricons/onlineMember.gif" border="0px" alt="'.$lang['rankmem'].'" title="'.$lang['rankmem'].'" />'.$lang['textsendall'];
            // User Rank Icons Mod End
            
================
Replace Code With:
================

            // User Rank Icons Mod Begin
            $supadminkey = $adminkey = $supmodkey = $modkey = $creativeteamkey = $memkey = '';
            $supadminkey = '<img src="./images/ricons/onlineSuperAdministrator.gif" border="0px" alt="'.$lang['ranksupadmin'].'" title="'.$lang['ranksupadmin'].'" /><strong><u><em>'.$lang['superadmin'].'</em></u></strong> - ';
            $adminkey = '<img src="./images/ricons/onlineAdministrator.gif" border="0px" alt="'.$lang['rankadmin'].'" title="'.$lang['rankadmin'].'" /><strong><u>'.$lang['textsendadmin'].'</u></strong> - ';
            $supmodkey = '<img src="./images/ricons/onlineSuperModerator.gif" border="0px" alt="'.$lang['ranksupmod'].'" title="'.$lang['ranksupmod'].'" /><em><strong>'.$lang['textsendsupermod'].'</strong></em> - ';
            $modkey = '<img src="./images ricons/onlineModerator.gif" border="0px" alt="'.$lang['rankmod'].'" title="'.$lang['rankmod'].'" /><strong>'.$lang['textsendmod'].'</strong> - ';
            $creativeteamkey = '<img src="./images ricons/onlineCreativeTeam.gif" border="0px" alt="'.$lang['creativeteam'].'" title="'.$lang['creativeteam'].'" /><strong>'.$lang['creativeteam'].'</strong> - ';
            $memkey = '<img src="./images/ricons/onlineMember.gif" border="0px" alt="'.$lang['rankmem'].'" title="'.$lang['rankmem'].'" />'.$lang['textsendall'].'';
            // User Rank Icons Mod End

====================================================================================================
=======
Step 5:
=======
=========================================
 Edit File: portal.php (If the Portal modification is installed)
=========================================
==========
Find Code:
==========

    case 'Moderator':
    case 'Super Moderator':

================
Replace Code With:
================

    case 'Creative Team':
    case 'Moderator':
    case 'Super Moderator':

================================
Find Code (If User Rank Icons Is Installed):
================================

        // User Rank Icons Mod Begin
        $supadminkey = $adminkey = $supmodkey = $modkey = $memkey = '';
        $supadminkey = '<img src="./images/ricons/onlineSuperAdministrator.gif" border="0px" alt="'.$lang['ranksupadmin'].'" title="'.$lang['ranksupadmin'].'" /><strong><u><em>'.$lang['superadmin'].'</em></u></strong> - ';
        $adminkey = '<img src="./images/ricons/onlineAdministrator.gif" border="0px" alt="'.$lang['rankadmin'].'" title="'.$lang['rankadmin'].'" /><strong><u>'.$lang['textsendadmin'].'</u></strong> - ';
        $supmodkey = '<img src="./images/ricons/onlineSuperModerator.gif" border="0px" alt="'.$lang['ranksupmod'].'" title="'.$lang['ranksupmod'].'" /><em><strong>'.$lang['textsendsupermod'].'</strong></em> - ';
        $modkey = '<img src="./images ricons/onlineModerator.gif" border="0px" alt="'.$lang['rankmod'].'" title="'.$lang['rankmod'].'" /><strong>'.$lang['textsendmod'].'</strong> - ';
        $memkey = '<img src="./images/ricons/onlineMember.gif" border="0px" alt="'.$lang['rankmem'].'" title="'.$lang['rankmem'].'" />'.$lang['textsendall'].'';
        // User Rank Icons Mod End
            
================
Replace Code With:
================

        // User Rank Icons Mod Begin
        $supadminkey = $adminkey = $supmodkey = $modkey = $creativeteamkey = $memkey = '';
        $supadminkey = '<img src="./images/ricons/onlineSuperAdministrator.gif" border="0px" alt="'.$lang['ranksupadmin'].'" title="'.$lang['ranksupadmin'].'" /><strong><u><em>'.$lang['superadmin'].'</em></u></strong> - ';
        $adminkey = '<img src="./images/ricons/onlineAdministrator.gif" border="0px" alt="'.$lang['rankadmin'].'" title="'.$lang['rankadmin'].'" /><strong><u>'.$lang['textsendadmin'].'</u></strong> - ';
        $supmodkey = '<img src="./images/ricons/onlineSuperModerator.gif" border="0px" alt="'.$lang['ranksupmod'].'" title="'.$lang['ranksupmod'].'" /><em><strong>'.$lang['textsendsupermod'].'</strong></em> - ';
        $modkey = '<img src="./images ricons/onlineModerator.gif" border="0px" alt="'.$lang['rankmod'].'" title="'.$lang['rankmod'].'" /><strong>'.$lang['textsendmod'].'</strong> - ';
        $creativeteamkey = '<img src="./images ricons/onlineCreativeTeam.gif" border="0px" alt="'.$lang['creativeteam'].'" title="'.$lang['creativeteam'].'" /><strong>'.$lang['creativeteam'].'</strong> - ';
        $memkey = '<img src="./images/ricons/onlineMember.gif" border="0px" alt="'.$lang['rankmem'].'" title="'.$lang['rankmem'].'" />'.$lang['textsendall'];
        // User Rank Icons Mod End

====================================================================================================
=======
Step 6:
=======
======================
Edit File: include/online.php
======================
==========
Find Code:
==========

            case 'Moderator':
            case 'Super Moderator':

================
Replace Code With:
================

            case 'Creative Team':
            case 'Moderator':
            case 'Super Moderator':

====================================================================================================
=======
Step 7:
=======
===============
Edit File: misc.php
===============
==============================================================================================
Find Code: (WARNING: If you have previously added any Additional Member Statuses, you will need to be extra careful with this step) 
==============================================================================================

            $orderby = "if (status='Super Administrator',1, if (status='Administrator', 2, if (status='Super Moderator', 3, if (status='Moderator', 4, if (status='member', 5, if (status='banned',6,7))))))";

====================================================================================================
Replace Code With: (WARNING: If you have previously added any Additional Member Statuses, you will need to be extra careful with this step)
====================================================================================================

            $orderby = "if (status='Super Administrator',1, if (status='Administrator', 2, if (status='Super Moderator', 3, if (status='Moderator', 4, if (status='Creative Team', 5, if (status='member', 6, if (status='banned',7,8)))))))";

====================================================================================================
=======
Step 7:
=======
=================
Edit File: member.php
=================
==========
Find Code:
==========

|| $memberinfo['status'] == 'Moderator'

================
Replace Code With:
================

|| $memberinfo['status'] == 'Moderator' || $memberinfo['status'] == 'Creative Team'

==========
Find Code:
==========

AND title != 'Moderator'

================
Replace Code With:
================

AND title != 'Moderator' AND title != 'Creative Team'

====================================================================================================
=======
Step 8:
=======
===================
Edit File: viewthread.php
===================
==========
Find Code:
==========

|| $title == 'Moderator'
----------------------------------------------------------------------------------------------------

Replace Code With:
----------------------------------------------------------------------------------------------------
|| $title == 'Moderator' || $title == 'Creative Team'
----------------------------------------------------------------------------------------------------

==========
Find Code:
==========

|| $post['status'] == 'Moderator'

================
Replace Code With:
================

|| $post['status'] == 'Moderator' || $post['status'] == 'Creative Team'

====================================================================================================
=======
Step 9:
=======
==============
Edit File: faq.php
==============
==========
Find Code:
==========

        $query = $db->query("SELECT * FROM ".X_PREFIX."ranks WHERE title !='Moderator' AND title !='Super Moderator' AND title !='Super Administrator' AND title !='Administrator' ORDER BY posts ASC");

================
Replace Code With:
================

        $query = $db->query("SELECT * FROM ".X_PREFIX."ranks WHERE title!='Creative Team' title !='Moderator' AND title !='Super Moderator' AND title !='Super Administrator' AND title !='Administrator' ORDER BY posts ASC");

====================================================================================================
========
Step 10:
========
=======================
Edit File: include/functions.php
=======================
==========
Find Code:
==========

function modcheck($status, $username, $mods) {

    if (X_ADMIN || in_array($status, array('Super Moderator'))) {
        return 'Moderator';
    }

    $retval = '';
    if ($status == 'Moderator') {
        $username = strtoupper($username);
        $mods = explode(',', $mods);
        foreach($mods as $key=>$moderator) {
            if (strtoupper(trim($moderator)) == $username) {
                $retval = 'Moderator';
                break;
            }
        }
    }
    return $retval;
}

================
Replace Code With:
================

function modcheck($status, $username, $mods) {

    if (X_ADMIN || in_array($status, array('Super Moderator'))) {
        return 'Moderator';
    }

    $retval = '';
    if (X_STAFF && !X_SMOD) {
        $username = strtoupper($username);
        $mods = explode(',', $mods);
        foreach ($mods as $key=>$moderator) {
            if (strtoupper(trim($moderator)) == $username) {
                $retval = 'Moderator';
                break;
            }
        }
    }
    return $retval;
}

====================================================================================================
========
Step 11:
========
==============
Edit File: cp.php
==============
==========
Find Code:
==========

            <option value="Moderator"><?php echo $lang['textmod']?></option>

===============
Add Code Below:
===============

            <!-- Additional Member Status: Creative Team Mod Begin -->
            <option value="Creative Team"><?php echo $lang['creativeteam']?></option>
            <!-- Additional Member Status: Creative Team Mod End -->

===================
Find Code (1st instance):
===================

            $modselect = $memselect = $banselect = '';

================
Replace Code With:
================

            $modselect = $creativeteamselect = $memselect = $banselect = '';

==========
Find Code:
==========

                    case 'Moderator':
                        $modselect = $selHTML;
                        break;

===============
Add Code Below:
===============

                    // Additional Member Status: Creative Team Mod Begin
                    case 'Creative Team':
                        $creativeteamselect = $selHTML;
                        break;
                    // Additioinal Member Status: Creative Team Mod End

==========
Find Code:
==========

                <option value="Moderator" <?php echo $modselect?>><?php echo $lang['textmod']?></option>

===============
Add Code Below:
===============

                <!-- Additional Member Status: Creative Team Mod Begin -->
                <option value="Creative Team" <?php echo $creativeteamselect?>><?php echo $lang['creativeteam']?></option>
                <!-- Additional Member Status: Creative Team Mod End -->

==========
Find Code:
==========

                $modselect = $memselect = $banselect = '';

================
Replace Code With:
================

                $modselect = $creativeteamselect = $memselect = $banselect = '';

====================================================================================================
========
Step 12:
========
===============
Edit File: cp2.php
===============
==========
Find Code:
==========

|| $rank['title'] == 'Moderator'

=================
Replace Code Below:
=================

|| $rank['title'] == 'Moderator' || $rank['title'] == 'Creative Team'

==========
Find Code:
==========

|| $ranks['title'] == 'Moderator'

================
Replace Code With:
================
|| $ranks['title'] == 'Moderator' || $ranks['title'] == 'Creative Team'

====================================================================================================
========
Step 13:
========
=======================
Edit File: lang/English.lang.php
=======================
============================
Add Code To End Of File Above ?>
============================

// Additional Member Status: Creative Team Mod Begin
$lang['creativeteam'] = 'Creative Team';
// Additional Member Status: Creative Team Mod End

====================================================================================================
========
Step 14:
========
===============================
Go To Administration Panel --> Templates
===============================
=========================
Edit Template: index_whosonline
=========================
====================================
Find Code: (If User Rank Icons Is NOT Installed)
====================================

<strong>$lang[textsendmod]</strong>

==========================================
Replace Code With: (If User Rank Icons Is NOT Installed)
==========================================

<strong>$lang[textsendmod]</strong> - <em><strong><u>$lang[creativeteam]</u></strong></em>

==========
Find Code: (If User Rank Icons Installed)
==========

$modkey

=====================================
Replace Code With: (If User Rank Icons Installed)
=====================================

$modkey$creativeteamkey

====================================================================================================
========
Step 16:
========
===============================
Go To Administration Panel --> Templates
===============================
===============
Edit Template: css
===============
==========
Find Code:
==========

.status_Moderator {
    text-decoration: none;
    font-weight: bold;
    color: $tabletext;
    font-family: Verdana;
    font-size: 10px;
}

===============
Add Code Below:
===============

.status_Creative_Team {
    text-decoration: underline;
    font-weight: bold;
    color: $tabletext;
    font-family: Verdana;
    font-size: 10px;
}

====================================================================================================
========
Step 15:
========

Upload image 'online_creativeteam.gif' to all theme directories (If using User Rank Icons)

====================================================================================================
Enjoy!